package com.dianping.cat.alarm.server.entity;

import com.dianping.cat.alarm.server.BaseEntity;
import com.dianping.cat.alarm.server.IVisitor;
import java.util.ArrayList;
import java.util.List;



public class Condition
  extends BaseEntity<Condition>
{
  private String m_interval;
  private int m_duration;
  private String m_alertType;
/*  16 */   private List<SubCondition> m_subConditions = new ArrayList();






/*  23 */   public void accept(IVisitor visitor) { visitor.visitCondition(this); }


  public Condition addSubCondition(SubCondition subCondition) {
/*  27 */     this.m_subConditions.add(subCondition);
/*  28 */     return this;
  }


  public boolean equals(Object obj) {
/*  33 */     if (obj instanceof Condition) {
/*  34 */       Condition _o = (Condition)obj;

      if (!equals(getInterval(), _o.getInterval())) {
/*  37 */         return false;
      }

/*  40 */       if (getDuration() != _o.getDuration()) {
/*  41 */         return false;
      }

/*  44 */       if (!equals(getAlertType(), _o.getAlertType())) {
/*  45 */         return false;
      }

/*  48 */       if (!equals(getSubConditions(), _o.getSubConditions())) {
/*  49 */         return false;
      }


/*  53 */       return true;
    }

/*  56 */     return false;
  }


/*  60 */   public String getAlertType() { return this.m_alertType; }



/*  64 */   public int getDuration() { return this.m_duration; }



/*  68 */   public String getInterval() { return this.m_interval; }



/*  72 */   public List<SubCondition> getSubConditions() { return this.m_subConditions; }





  public void mergeAttributes(Condition other) {
/*  92 */     if (other.getInterval() != null) {
/*  93 */       this.m_interval = other.getInterval();
    }

/*  96 */     this.m_duration = other.getDuration();

/*  98 */     if (other.getAlertType() != null) {
/*  99 */       this.m_alertType = other.getAlertType();
    }
  }

  public Condition setAlertType(String alertType) {
/* 104 */     this.m_alertType = alertType;
/* 105 */     return this;
  }

  public Condition setDuration(int duration) {
/* 109 */     this.m_duration = duration;
/* 110 */     return this;
  }

  public Condition setInterval(String interval) {
/* 114 */     this.m_interval = interval;
/* 115 */     return this;
  }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/server/entity/Condition.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */